
$Id: $

package Volume;

use strict;
use 5.008000;
use warnings;

sub new($)
{
    my $proto = shift;
    my $class = ref($proto) || $proto;
    my $self = {};

    $self->{NAME} = undef;
    $self->{LUN} = undef;
    $self->{ACCESS} = undef;
    $self->{PORTS} = undef;

    bless($self, $class);

    return ($self);
}

sub Name($;$)
{
    my $self = shift;
    my $name = shift;

    $self->{NAME} = $name if ($name);

    return ($self->{NAME});
}

sub Lun($;$)
{
    my $self = shift;
    my $lun = shift;

    $self->{LUN} = $lun if (defined($lun) && length($lun)>0);

    return ($self->{LUN});
}

sub Access($;$)
{
    my $self = shift;
    my $access = shift || '';

    $self->{ACCESS} = $access if (length($access)>0);

    return ($self->{ACCESS});
}

sub Ports($;$)
{
    my $self = shift;
    my $ports = shift;

    $self->{PORTS} = $ports if ($ports);
    return ($self->{PORTS});
}

sub ToString($)
{
    my $self = shift;

    return "$self->{NAME} => {Lun => $self->{LUN}, Access => $self->{ACCESS},"
         . " Ports => $self->{PORTS}}";
}

1;
